File tree 2 files changed +17
-0
lines changed
share/minizinc/std/stdlib 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ https://github.com/MiniZinc/libminizinc/issues.
6
6
7
7
.. _unreleased :
8
8
9
+ Changes:
10
+ ^^^^^^^^
11
+ - Add ``mzn_max_version_required `` to enable models to speficy the maximum
12
+ version of MiniZinc required to run the model (:bugref: `872 `).
13
+
9
14
Bug fixes:
10
15
^^^^^^^^^^
11
16
- Fix the rewriting of the multidimensional search annotations to ensure
Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ constraint
24
24
mzn_version_to_string (mzn_compiler_version ()),
25
25
);
26
26
27
+ /** @group stdlib.language If defined, this can be used to check that the MiniZinc compiler is not newer than the given version. */
28
+ opt int : mzn_max_version_required ;
29
+
30
+ constraint
31
+ assert (
32
+ absent (mzn_max_version_required ) \/ deopt (mzn_max_version_required ) >= mzn_compiler_version (),
33
+ "This model only works with MiniZinc up to version " ++
34
+ mzn_version_to_string (deopt (mzn_max_version_required )) ++
35
+ " but you are running version " ++
36
+ mzn_version_to_string (mzn_compiler_version ()),
37
+ );
38
+
27
39
/***
28
40
@groupdef stdlib.options Compiler options
29
41
*/
You can’t perform that action at this time.
0 commit comments